package com.tgsoft.kdcloud.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 生产订单状态枚举
 *
 * @author 阿沐 babamu@126.com
 * <a href="https://maku.net">MAKU</a>
 */
@Getter
@AllArgsConstructor
public enum MoStatusEnum {

    plan(1, "计划"),
    submit(2, "计划确认"),
    send(3, "下达"),
    start(4, "开工"),
    finish(5, "完工"),
    end(6, "结案"),
    settle(7, "结算");


    private final Integer code;
    private final String value;


    public static String getValue(Integer code) {
        for (MoStatusEnum value : MoStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getValue();
            }
        }
        return null;
    }


    public static MoStatusEnum getByCode(Integer code) {
        for (MoStatusEnum value : MoStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
